import Vue from 'vue'
import VueRouter from 'vue-router'
import Dashboard from '../components/Dashboard.vue'


 


Vue.use(VueRouter)



let originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (path) {
  return originalPush.call(this, path).catch(err => {
    console.log(err);
  })
}
const routes = [

  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/regist',
    name: 'Regist',
    component: () => import('../views/Regist.vue')

  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard,
    children: [

      {
        path: '/hr-personnel',
        name: 'HR-personnel',
        component: () => import('../components/HR-Personnel.vue')
      },
      {
        path: '/hr-salary',
        name: 'HR-salary',
        component: () => import('../components/HR-Salary.vue')
      },
      {
        path: '/hr-rest',
        name: 'Rest',
        component: () => import('../components/HR-Rest.vue')
      },
      {
        path: '/hr-personal',
        name: 'HR-personal',
        component: () => import('../components/HR-Personal.vue')
      },
     
      {
        path: '/resign',
        name: 'Resign',
        component: () => import('../components/OA-resign.vue')
      },
      {
        path: '/subsidy',
        name: 'Subsidy',
        component: () => import('../components/OA-subsidy.vue')
      },
      {
        path: '/eam-property',
        name: 'EAM-property',
        component: () => import('../components/EMA-property.vue')
      },
      // srm模块
      {
        path: '/srmlist',
        name: 'SRMlist',
        component: () => import('../components/SRM-list.vue')
      },
      {
        path: '/srmSupplierlist',
        name: 'SRMSupplierlist',
        component: () => import('../components/SRM-SupplierList.vue')
      },
      
    ]
  },
]


const router = new VueRouter({
  routes
})

export default router